package com.qg.controller;


import com.alibaba.dubbo.config.annotation.Reference;
import com.qg.dto.Dto;
import com.qg.module.pojo.QgGoodsTempStock;
import com.qg.module.vo.OrderVo;
import com.qg.service.LocalOderService;
import com.qg.service.QgGoodsTempStockService;
import com.qg.utils.Constants;
import com.qg.utils.DtoUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Date;
import java.util.List;

@Controller
@RequestMapping("/api")
public class OrderController {

    @Autowired
    private LocalOderService localOderService;

    @Reference
    QgGoodsTempStockService qgGoodsTempStockService;
    /***
     * 查询订单
     * @return
     */
    @RequestMapping("/v/queryOrderList")
    @ResponseBody
    public Dto<List<OrderVo>> queryOrderList(String token) throws Exception {

        return localOderService.queryOrderList(token);
    }

    @RequestMapping("/v/prepay")
    @ResponseBody
    public Dto prepay(String orderId,String token) throws Exception {
        return localOderService.queryOrderById(orderId,token);
    }
}
